package models;

import play.*;
import play.db.jpa.*;

import javax.persistence.*;
import java.util.*;

@Entity
public class UserCityType extends Model {
	
	
	   private int cityType;
	   private String cityTypeDesc;
	   
	   public UserCityType(int cityType , String cityTypeDesc){
		   this.cityType = cityType;
		   this.cityTypeDesc = cityTypeDesc;
	   }
	  public static UserCityType findOrCreatecityType(int cityType,String desc){
		  UserCityType  newcityType = UserCityType.find("cityType = ?", cityType ).first();
		  if(newcityType == null){
			  return new UserCityType(cityType, desc);
		  }
		  return newcityType;
	  }   
	  public int getcityType() {
		   return cityType;
	   }
	   public void setcityType(int cityType) {
		 this.cityType = cityType;
	   }
	  public String getcityTypeDesc() {
		 return cityTypeDesc;
	  }
	  public void setcityTypeDesc(String cityTypeDesc) {
		 this.cityTypeDesc = cityTypeDesc;
	   }
    
}
